package com.ruoyi.common.utils;

import java.util.LinkedList;

public class FixedSizeQueue<E> extends LinkedList<E> {


    private int size;


    public FixedSizeQueue(int size) {
        this.size = size;
    }

    @Override
    public boolean offer(E e) {
        if(size() >= size){
            poll();
        }
        return super.offer(e);
    }
}
